<template>
  <view class="setting-container" :style="{ height: `${windowHeight}px` }">
    <view class="menu-list">
      <view class="list-cell list-cell-arrow">
        <view class="menu-item-box" @click="handleToGy">
          <!-- <view class="iconfont icon-refresh menu-icon"></view> -->
          <view class="view-gy">关于APP</view>
          <view class="text-right view-txt" @click="handleToUpgrade"
            >版本{{ version }}</view>
        </view>
      </view>
      <view class="list-cell list-cell-arrow" @click="handleToPwd">
        <view class="menu-item-box">
          <!-- <view class="iconfont icon-password menu-icon"></view> -->
          <view class="view-mm">更改密码</view>
        </view>
      </view>
    </view>
    <view class="cu-list menu">
      <view class="cu-item item-box">
        <view class="content text-center" @click="handleLogout">
          <text class="text-black text-tc">退出登录</text>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      version: getApp().globalData.config.appInfo.version,
      windowHeight: uni.getSystemInfoSync().windowHeight,
    };
  },
  methods: {
    handleToGy() {
      this.$tab.navigateTo("");
    },
    handleToPwd() {
      this.$tab.navigateTo("/pages/my/password/index");
    },
    handleToUpgrade() {
      this.$tab.navigateTo("/pages/my/myxiugaimima/index");
    },
    handleCleanTmp() {
      this.$modal.showToast("");
    },
    handleLogout() {
      this.$modal.confirm("确定注销并退出系统吗？").then(() => {
        this.$store.dispatch("LogOut").then(() => {
          this.$tab.reLaunch("/pages/index");
        });
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.page {
  background-color: #f8f8f8;
}

.item-box {
  background-color: #ffffff;
  margin: 0px 10px 0px 10px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 10rpx;
  border-radius: 8rpx;
  color: #303133;
  font-size: 32rpx;
}
.menu-list {
  margin: 10px 10px;
}
.view-gy {
  font-size: 16px;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #343434;
  line-height: 22px;
}
.view-txt {
  font-size: 16px;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #8c8c8c;
  line-height: 22px;
}
.view-mm {
  font-size: 16px;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #343434;
  line-height: 22px;
}
.text-tc {
  font-size: 20px;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #343434;
  line-height: 26px;
}
.cu-list.menu>.cu-item {
    min-height: 44px;
}
</style>
